import random
import time

random.random()

print(random.random())

print(random.randint(1,100))
alist = [1,2,3,4,5,6,7]
print(random.choice(alist))

print(random.choices(alist,k = 3))

#打乱，洗牌
random.shuffle(alist)
print(alist)

time.sleep(0.5)
print("-------等待x秒后在执行-----------")

#获取当前时间戳
print(time.time())

print(time.localtime())

#时间元组和时间字符串转换
str1 = time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())
print(str1)
str2 = "2008-08-08 23:59:24"
timeTuple = time.strptime(str2,"%Y-%m-%d %H:%M:%S")
print(timeTuple)